/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virtual.BD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "disciplina")
@NamedQueries({
    @NamedQuery(name = "Disciplina.findAll", query = "SELECT d FROM Disciplina d"),
    @NamedQuery(name = "Disciplina.findByCdDisciplina", query = "SELECT d FROM Disciplina d WHERE d.cdDisciplina = :cdDisciplina"),
    @NamedQuery(name = "Disciplina.findByNmDisciplina", query = "SELECT d FROM Disciplina d WHERE d.nmDisciplina = :nmDisciplina"),
    @NamedQuery(name = "Disciplina.findByQtCargaHoraria", query = "SELECT d FROM Disciplina d WHERE d.qtCargaHoraria = :qtCargaHoraria")})
public class Disciplina implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cd_disciplina")
    private Integer cdDisciplina;
    @Basic(optional = false)
    @Column(name = "nm_disciplina")
    private String nmDisciplina;
    @Lob
    @Column(name = "ds_ementa")
    private String dsEmenta;
    @Column(name = "qt_carga_horaria")
    private Short qtCargaHoraria;

    public Disciplina() {
    }

    public Disciplina(Integer cdDisciplina) {
        this.cdDisciplina = cdDisciplina;
    }

    public Disciplina(Integer cdDisciplina, String nmDisciplina) {
        this.cdDisciplina = cdDisciplina;
        this.nmDisciplina = nmDisciplina;
    }

    public Integer getCdDisciplina() {
        return cdDisciplina;
    }

    public void setCdDisciplina(Integer cdDisciplina) {
        this.cdDisciplina = cdDisciplina;
    }

    public String getNmDisciplina() {
        return nmDisciplina;
    }

    public void setNmDisciplina(String nmDisciplina) {
        this.nmDisciplina = nmDisciplina;
    }

    public String getDsEmenta() {
        return dsEmenta;
    }

    public void setDsEmenta(String dsEmenta) {
        this.dsEmenta = dsEmenta;
    }

    public Short getQtCargaHoraria() {
        return qtCargaHoraria;
    }

    public void setQtCargaHoraria(Short qtCargaHoraria) {
        this.qtCargaHoraria = qtCargaHoraria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdDisciplina != null ? cdDisciplina.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Disciplina)) {
            return false;
        }
        Disciplina other = (Disciplina) object;
        if ((this.cdDisciplina == null && other.cdDisciplina != null) || (this.cdDisciplina != null && !this.cdDisciplina.equals(other.cdDisciplina))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "virtual.BD.Disciplina[cdDisciplina=" + cdDisciplina + "]";
    }

}
